class ConceptosCobroController < ApplicationController
  before_action :set_concepto_cobro, only: [:show, :edit, :update, :destroy]

  # GET /conceptos_cobro
  # GET /conceptos_cobro.json
  def index
    @conceptos_cobro = ConceptoCobro.all
  end

  # GET /conceptos_cobro/1
  # GET /conceptos_cobro/1.json
  def show
  end

  # GET /conceptos_cobro/new
  def new
    @concepto_cobro = ConceptoCobro.new
  end

  # GET /conceptos_cobro/1/edit
  def edit
  end

  # POST /conceptos_cobro
  # POST /conceptos_cobro.json
  def create
    @concepto_cobro = ConceptoCobro.new(concepto_cobro_params)

    respond_to do |format|
      if @concepto_cobro.save
        format.html { redirect_to conceptos_cobro_path, notice: 'Concepto cobro was successfully created.' }
        format.json { render action: 'show', status: :created, location: @concepto_cobro }
      else
        format.html { render action: 'new' }
        format.json { render json: @concepto_cobro.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /conceptos_cobro/1
  # PATCH/PUT /conceptos_cobro/1.json
  def update
    respond_to do |format|
      if @concepto_cobro.update(concepto_cobro_params)
        format.html { redirect_to conceptos_cobro_path, notice: 'Concepto cobro was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: 'edit' }
        format.json { render json: @concepto_cobro.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /conceptos_cobro/1
  # DELETE /conceptos_cobro/1.json
  def destroy
    @concepto_cobro.destroy
    respond_to do |format|
      format.html { redirect_to conceptos_cobro_url }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_concepto_cobro
      @concepto_cobro = ConceptoCobro.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def concepto_cobro_params
      params.require(:concepto_cobro).permit(:Clave, :Nombre, :Orden, :Monto)
    end
end
